<%@page language="java" contentType="text/html;charset=UTF-8"%>
<%@include file="/WEB-INF/core/common/top.jsp" %>
<%@taglib prefix="s" uri="/struts-tags"%>
<link type="text/css" rel="stylesheet" href="${ctx}/core/styles/validatorAuto.css" />
<script src="${ctx}/core/scripts/jquery_last.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidator.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>

<script language="javascript">
<!--
	$(document).ready(function(){
		$.formValidator.initConfig({formid:"form0",onerror:function(msg){showMessage(msg);}});
		$("#serverName").formValidator().inputValidator({min:1,max:50,onerror:"<s:text name='server.name.not.empty'/>",onerrormax:"<s:text name='server.name.over.length'/>"});
		//$("#ip").formValidator().inputValidator({min:1,onerror:"<s:text name='ip.not.empty'/>"}).regexValidator({regexp:"ip4",datatype:"enum",onerror:"<s:text name='ip.form.error'/>"});
		$("#ip").formValidator().inputValidator({min:1,onerror:"<s:text name='ip.not.empty'/>"});
		$("#port").formValidator().inputValidator({min:1,max:65535,type:"number",onerror:"<s:text name='port.range'/>"}).regexValidator({regexp:"intege",datatype:"enum",onerror:"<s:text name='port.integer'/>"});
		$("#userName").formValidator().inputValidator({min:1,max:50,onerror:"<s:text name='user.name.not.empty'/>",onerrormax:"<s:text name='user.name.over.length'/>"});
		$("#userPW").formValidator().inputValidator({min:1,max:50,onerror:"<s:text name='pw.not.empty'/>",onerrormax:"<s:text name='pw.over.length'/>"});
		$("#fileDir").formValidator().inputValidator({min:1,max:100,onerror:"<s:text name='dir.not.empty'/>",onerrormax:"<s:text name='dir.over.length'/>"});
	});	

	function doCancel(){
		location='${ctx}/contentManage/ftpConfigSearch.action?act=reQuery';
	}
//-->	
</script>

<body style="overflow-x:hidden;overflow-y:auto;" >
<form method="post" action="${ctx}/contentManage/ftpManage.action" name="form0" id="form0">
	<s:hidden name="pageState" value="%{pageState}"></s:hidden>
 	<s:if test="pageState=='add'">  
 		<s:hidden name="act" value="addSubmit"></s:hidden>
	</s:if>
	<s:if test="pageState=='edit'">
		<s:hidden name="act" value="editSubmit"></s:hidden>
		<s:hidden name="ftpConfig.id" value="%{ftpConfig.id}" />
	</s:if>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<%@include file="/WEB-INF/core/common/message.jsp"  %>
   <tr>
    <td width="8"><img src="${ctx}/core/images/button_05.gif" width="8" height="27" /></td>
    <td width="99%" align="left" valign="middle" background="${ctx}/core/images/button_06.gif" class="bluecu">&nbsp;<img src="${ctx}/core/images/icon_04.gif" />&nbsp;<s:if test="pageState=='edit'"><s:text name="ftp.modify"/></s:if><s:if test="pageState=='add'"><s:text name="ftp.add"/></s:if></td>
    <td width="8"><img src="${ctx}/core/images/button_07.gif" width="8" height="27" /></td>
  </tr>

  <tr>
    <td colspan="4" class="biaoge">
         <table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF">
                 <tr align="left">
                      <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="ftp.server.name"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA">
                      		<s:textfield id="serverName" name="ftpConfig.serverName" value="%{ftpConfig.serverName}" class="textbox_css" style="width:200px" theme="simple"/>
					  </td>

					  <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="ftp.type"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA" >&nbsp;
                      <s:hidden name="ftpConfig.type" value="%{ftpConfig.type}"/>
                      	<s:if test="ftpConfig.type==1"><s:text name="ftp.asset.download"/></s:if>
                      	<s:if test="ftpConfig.type==2"><s:text name="ftp.content.publish"/></s:if>
					  		<!-- 
					  		<select name="ftpConfig.type" style="width:100px">
					  			<option value="1" <s:if test="ftpConfig.type==1">selected</s:if>><s:text name="ftp.asset.download"/></option>
					  			<option value="2" <s:if test="ftpConfig.type==2">selected</s:if>><s:text name="ftp.content.publish"/></option>
					  		</select>
					  		 -->
					  </td>					  
                 </tr>
                 <tr align="left">
                      <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="ftp.server.ip"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA" >
                      		<s:textfield id="ip" name="ftpConfig.serverIP" value="%{ftpConfig.serverIP}" class="textbox_css" style="width:200px" theme="simple"/>
					  </td>

					  <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="ftp.server.port"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA" >
                      		<s:textfield id="port" name="ftpConfig.serverPort" value="%{ftpConfig.serverPort}" class="textbox_css" style="width:200px" theme="simple"/>
					  </td>
                 </tr>
                 <tr align="left">
                      <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="ftp.user.name"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA" >
                      		<s:textfield id="userName" name="ftpConfig.userName" value="%{ftpConfig.userName}" class="textbox_css" style="width:200px" theme="simple"/>
					  </td>

					  <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="ftp.user.pwd"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA" >
                      		<input type="password" id="userPW" name="ftpConfig.userPW" value="<s:property value='ftpConfig.userPW'/>" class="textbox_css" style="width:200px"/>
					  </td>
                 </tr>
                 <tr align="left">
                      <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="ftp.dir"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA" >
                      		<s:textfield id="fileDir" name="ftpConfig.fileDir" value="%{ftpConfig.fileDir}" class="textbox_css" style="width:200px" theme="simple"/>
					  </td>

					  <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="ftp.status"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA">
					  		<select name="ftpConfig.status" style="width:100px">
					  			<option value="1" <s:if test="ftpConfig.status==1">selected</s:if>><s:text name="message.status.release"/></option>
					  			<option value="0" <s:if test="ftpConfig.status==0">selected</s:if>><s:text name="message.status.cancel"/></option>
					  		</select>
					  </td>
                 </tr>               
                 <tr>
                      <td height="10" colspan="6" background="../core/images/line5.gif">&nbsp;</td>
                 </tr>
                 <tr>
                      <td height="25" colspan="6" align="center">
							<input name="button22" type="submit" class="btn" value=" <s:text name='button.save'/> "/>
			                <input type="button" name="Button11" value=" <s:text name='button.return' /> " class="btn" onClick="doCancel();" />
			           </td>
                 </tr>
             </table>
            </td>
          </tr>
    </table>
   </form>
</body>
